package uk.ac.ebi.bioinvindex.utils.mock;

import uk.ac.ebi.bioinvindex.model.impl.ContactImpl;
import uk.ac.ebi.bioinvindex.model.impl.PublicationImpl;
import uk.ac.ebi.bioinvindex.model.impl.StudyImpl;
import uk.ac.ebi.bioinvindex.model.impl.processing.AssayImpl;

import java.util.Date;

/**
 * User: Nataliya Sklyar (nsklyar@ebi.ac.uk)
 * Date: Sep 14, 2007
 */
public class StudyBuilder {

	private StudyImpl study;

	public StudyBuilder() {
		study = new StudyImpl();
	}

	public StudyImpl buildStudy() {
		return study;
	}

	public StudyBuilder id(Long id) {
		study.setId(id);
		return this;
	}

	public StudyBuilder acc(String acc) {
		study.setAcc(acc);
		return this;
	}

	public StudyBuilder title(String title) {
		study = new StudyImpl(title);
		return this;
	}

	public StudyBuilder description(String desctiption) {
		study.setDescription(desctiption);
		return this;
	}

	public StudyBuilder objective(String objective) {
		study.setObjective(objective);
		return this;
	}

	public StudyBuilder dates(Date releaseDate, Date submissionDate) {
		study.setReleaseDate(releaseDate);
		study.setSubmissionDate(submissionDate);
		return this;
	}

	public StudyBuilder contact(ContactImpl contact) {
		study.addContact(contact);
		return this;
	}

	public StudyBuilder assay(AssayImpl assay) {
		study.addAssay(assay);
		return this;
	}

	public StudyBuilder publication(PublicationImpl publication) {
		study.addPublication(publication);
		return this;
	}

	public static void main(String[] args) {
		StudyBuilder builder = new StudyBuilder();

		StudyImpl study1 = builder.title("rrrr")
				.description("dfdfdfdf")
				.objective("fgfgdgd")
				.buildStudy();
		System.out.println("study1 = " + study1);

	}
}
